
package com.sfdlJPush.api;

import java.util.HashMap;
import java.util.Map;

import android.view.View;

import com.sfdlJPush.controller.api.ApiListenrDefaultImpl;
import com.sfdlJPush.controller.api.B5MBasePaggingRequest;
import com.sfdlJPush.utils.UserInfoManage;
import com.sfdlJPush.utils.VerifyData;
import com.sfdlJPush.widget.pulltorefresh.PullToRefreshBase;

public class GetEnquiryListRequest extends B5MBasePaggingRequest<GetEnquiryListResponse>
{
    public GetEnquiryListRequest(ApiListenrDefaultImpl apiListenrDefaultImpl, View view, PullToRefreshBase pullToRefreshBase)
    {
        super(apiListenrDefaultImpl, view, pullToRefreshBase);
        // TODO Auto-generated constructor stub
    }

    @Override
    public Class<GetEnquiryListResponse> getResponseClass()
    {
        // TODO Auto-generated method stub
        return GetEnquiryListResponse.class;
    }

    @Override
    public String getApiMethod()
    {
        // TODO Auto-generated method stub
        return "CompanyEnquiry/getEnquiryList";
    }

    @Override
    public void setApiBody(Map<String, String> map)
    {
        // TODO Auto-generated method stub
        super.setApiBody(map);
        map.put("sign", getMD5Sign());
    }

    private String getMD5Sign()
    {
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("username", UserInfoManage.getInstance().getUser().username);
        map.put("companyId", UserInfoManage.companyId);
        map.put("key", UserInfoManage.getInstance().getUser().key);
        return VerifyData.getMD5Sign(map);
    }
}
